﻿@using EasyCourse.Model;
@{
    var courseOtherInfoTypeDic = CourseOtherInfoManage.Instance.CourseOtherInfoTypeDic;
    var courseOtherInfoTypeIconDic = CourseOtherInfoManage.Instance.CourseOtherInfoTypeIconDic;
    int? TypeCode = null;
    if (!string.IsNullOrEmpty(Convert.ToString(ViewData["TypeCode"])))
    {
        TypeCode = ViewData["TypeCode"] as int?;
    }
    CommonPageInfo pageInfo = ViewData[CommonViewDataKey.CommonPageInfo] as CommonPageInfo;
    string para = "CourseId=" + pageInfo.CourseId;
}

<div class="col-xs-2">
    <div class="dropdown theme-dropdown clearfix">
        <a id="dropdownMenu1" href="#" role="button" class="sr-only dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
        <ul id="courseInfoList" class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
            @{
                var index = 0;
                foreach (var key in courseOtherInfoTypeDic.Keys)
                {
                    string cssName = "";
                    if (TypeCode == key)
                    {
                        cssName = "active";
                    }
                    else if (TypeCode == null && index == 0)
                    {
                        cssName = "active";
                    }
                    <li class='@cssName' id="@key" role="presentation">
                        <a role="menuitem" tabindex="-1" href="javascript:void(0)">
                            <span class="glyphicon @courseOtherInfoTypeIconDic[key]"></span>&nbsp<em>@courseOtherInfoTypeDic[key]</em>
                        </a>
                    </li>
                    if (index != courseOtherInfoTypeDic.Count() - 1)
                    {
                        <li role="presentation" class="divider"></li>
                    }
                    index++;
                }
            }
            <li role="presentation" class="divider"></li>
            <li role="presentation">
                <a role="menuitem" tabindex="-1" href="~/html/courseFeedback.html?@para">
                    <span class="glyphicon glyphicon-user"></span>&nbsp<em>教学反馈评论管理</em>
                </a>
            </li>
            <li role="presentation" class="divider"></li>

        </ul>
    </div>
</div>
<script src="~/Content/jquery1.11.1.min.js"></script>
<script>
    $("#courseInfoList li").click(function () {
        var _typeCode = $(this).attr("id");
        window.location.href = "@Url.Action("CourseOtherInfoList", "CourseOtherInfo")?@para&TypeCode=" + _typeCode;
    });

</script>

